package ouyangye.second;

// 测试类
public class Test {
    public static void salCompute(Employee employee) {
        System.out.println(employee.getName());
        employee.work();
        employee.addSalary();

        if (employee instanceof Worker) {
            ((Worker) employee).repairEquipment();
        } else if (employee instanceof Manager) {
            ((Manager) employee).manageTeam();
        }
    }

    public static void main(String[] args) {
        Employee worker = new Worker("张三", 8000, 3);
        Employee manager = new Manager("李四", 15000, 5);


        salCompute(worker);
        salCompute(manager);
    }
}